<!DOCTYPE html>
<html >
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>竞赛下拉框</title>
		<script src="../../script/mui.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
		<link rel="stylesheet" type="text/css" href="../../css/base.css"/>
		<script src="../../script/jquery.min.js" type="text/javascript"></script>
		<script type="text/javascript" charset="utf-8">
			mui.init();
		</script>
		<style type="text/css" media="screen">
			html, body {
				background-color: transparent;
			}
			.mui-table-view-cell {
				padding: 6px 15px;
			}
			.selected-cell {
				color: #18b4ed;
			}
			.mui-table-view-cell:active {
				color: #999999;
				background-color: #FFFFFF;
			}
			.mui-table-view-cell.mui-active {
				color: #999999;
				background-color: #FFFFFF;
			}
			.base_right_reddiv {
				top: 8px;
				left: 70px;
				width: 5px;
				height: 5px;
			}
		</style>
	</head>
	<body>
		<div class="boyOrGirl show" id="boyOrGirl"  >
			<ul class="mui-table-view font14 base_grey tcenter " >
				<li class="mui-table-view-cell" id="item1" type='1'>
					学霸挑战赛
				</li>
				<li class="mui-table-view-cell " id='item2' type='2'>
					学霸等你来
				</li>
				<li class="mui-table-view-cell" id="item4" type='4'>
					个人中心
				</li>
				<li class="mui-table-view-cell" id="item5" type='5'>
					榜单分享 <div id="redPoint_xuexi_div" class="redPointMessage base_right_reddiv" ></div>
				</li>
				<li class="mui-table-view-cell" id="item6" type='6'>
					意见反馈 <div id="redPoint_xuexi_div1" class="redPointMessage base_right_reddiv" ></div>
				</li>
			</ul>
		</div>
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script src="../../script/mui.min.js"></script>
	<script type="text/javascript">
		var selectNum = '';
		var isreddot = '0';
		//0:有红点  1：无红点
		apiready = function() {
			isRedDot();
			setupCellClick();
		}
		//是否显示小红点
		function isRedDot() {
			isreddot = $api.getStorage('isreddot');
			if(isreddot ==1){//分享榜单
		        $("#redPoint_xuexi_div").hide();
		     }else{
		       $("#redPoint_xuexi_div").show();
		       
		     }
		     if($api.getStorage('isreddot1') ==1){//意见反馈
		        $("#redPoint_xuexi_div1").hide();
		     }else{
		        $("#redPoint_xuexi_div1").show();
		     }
		}

		function setupCellClick() {
			$('.mui-table-view-cell').unbind('click');
			$('.mui-table-view-cell').click(function(event) {
				event.stopPropagation();
				var currentCategoryId = $(this).attr('id');
				var currentCategorytype = $(this).attr('type');
				$('.mui-table-view-cell').removeClass('selected-cell');
				$('#' + currentCategoryId).addClass('selected-cell');
				if (currentCategorytype == 5) {
					$api.setStorage('isreddot', 1);
					$("#redPoint_xuexi_div").hide();
				}
				if (currentCategorytype == 6) {
					$api.setStorage('isreddot1', 1);
					$("#redPoint_xuexi_div1").hide();
				}
				api.sendEvent({
					name : 'CompetitionCategoryNotifi',
					extra : {
						currentCategoryId : currentCategoryId,
						currentCategorytype : currentCategorytype
					}
				});
				api.setFrameAttr({
					name : 'Competition_SelectFrame',
					hidden : true
				});
			});
		}
	</script>
</html>